<?php
namespace app\login\controller;
use think\Controller;
use think\Request;
use \think\Db;
class Index extends Controller
{
     /*
     * 获取SessionKey
     */
    public function getSessionKey(){
        $data = input('post.');
        $check = $this->validate($data,'Mini.code');
        if($check !==true){
           return api_return($check);
        }
        $result = model('Mini')->getSessionKey($data);
        if($result != 10001 ){
            return api_return($result);
        }else{
            return api_return('10002',$options);
        }
    }

     /*
     * 获取用户信息
     *
     */
    public function getUserInfo(){
        $data = input('post.');
        $check = $this->validate($data,'Mini.user');
        if($check !==true){
            return api_return($check);
        }
        $options = model('Mini')->getUserInfo($data);
        if($result !== false ){
            return api_return($result);
        }else{
            return api_return('10002',$options);
        }
    }

}
